{% extends "blog/base.html" %}

{% block htmlTitle %}标签: {{ tag.name }}{% endblock %}

{% block head %}{% endblock %}

{% block pageTitle %}标签: {{ tag.name }}{% endblock %}
{% block pageSubTitle %}共{{ tag.count }}篇文章{% endblock %}

{% block content %}
{% for article in articles %}
<div class="mdui-card mdui-hoverable card mdui-typo">
  <div class="mdui-card-primary">
    <div class="mdui-card-primary-title">
      <a href="{{ url_for('blog.article', article_id=article.id) }}">{{ article.title }}</a>
    </div>
    <div class="mdui-card-primary-subtitle">
      <i class="mdui-icon material-icons">access_time</i>
      {{ article.date + " " + article.time }}
    </div>
  </div>
  <div class="mdui-card-content">
    {{ article.excerpt }}
  </div>
  <div class="mdui-card-actions">
    <div class="mdui-chip">
      <span class="mdui-chip-icon mdui-color-theme"><i class="mdui-icon material-icons">class</i></span>
      <span class="mdui-chip-title">
        <a href="{{ url_for('blog.category', category_name=article.category) }}">{{ article.category }}</a>
      </span>
    </div>
    {% for tag in article.tag %}
      <a class="tag" href="{{ url_for('blog.tag_show', tag_name=tag) }}">{{ tag }}</a>
    {% endfor %}
  </div>
</div>
{% endfor %}

<div class="card mdui-card mdui-text-center mdui-hoverable">
  <div class="mdui-card-content">
    {% if page > 1 %}
        <a href="{{ url_for('blog.tag_show', category_name=category.name, page=page - 1) }}" class="mdui-btn mdui-ripple"><i class="mdui-icon material-icons">navigate_before</i>上一页</a>
    {% endif %}
        <button class="mdui-btn mdui-color-theme-accent mdui-ripple">{{ page }}/{{ tot_page }}</button>
    {% if tot_page > page %}
        <a href="{{ url_for('blog.tag_show', category_name=category.name, page=page + 1) }}" class="mdui-btn mdui-ripple">下一页<i class="mdui-icon material-icons">navigate_next</i></a>
    {% endif %}
  </div>
</div>

{% endblock %}